package com.github.cosycode.web.base.post;


/**
 * <b>Description : </b> 用于全局添加警告信息
 *
 * @author CPF
 * @date 2019/10/25 11:41
 **/
public class LocalPostCodeHolder {

    private static final ThreadLocal<IPostCode> CODE_THREAD_LOCAL = new ThreadLocal<>();

    public static void putWarning(IPostCode warningCode) {
        CODE_THREAD_LOCAL.set(warningCode);
    }

    public static IPostCode getWarning() {
        return CODE_THREAD_LOCAL.get();
    }

    public static void remove() {
        CODE_THREAD_LOCAL.remove();
    }

}
